--
-- Author: shunguo.chen
-- Date: 2017-12-28 15:29:21
--
-- PvpFailView pvp胜利界面

local fileName = string.getModeName(...)
local ClassRef = class(fileName, app.mvc.ViewBase)

ClassRef.VIEW_ROOT_RES = Res.PvpFailScene

function ClassRef:init()
	self._ui.Button_close:addClickEventListener(function()
			self:closeView()
		end)
end

function ClassRef:refresh(strs, reason)
	if #strs == 1 then
		self._ui.tips_mid:setVisible(true)
		self._ui.tips_up:setVisible(false)
		self._ui.tips_down:setVisible(false)

		self._ui.tips_mid:setString(strs[1])
	elseif #strs == 2 then
		self._ui.tips_mid:setVisible(false)
		self._ui.tips_up:setVisible(true)
		self._ui.tips_down:setVisible(true)

		self._ui.tips_up:setString(strs[1])
		self._ui.tips_down:setString(strs[2])
	else
		self._ui.tips_mid:setVisible(false)
		self._ui.tips_up:setVisible(false)
		self._ui.tips_down:setVisible(false)
	end

	-- if reason then
	-- 	self._ui.tips_1:setString(reason)
	-- 	self._ui.tips_img:setVisible(true)
		display.setNodesMiddle(self._ui.Panel, self._ui.tips_img, self._ui.tips_1)
	-- else
	-- 	self._ui.tips_1:setString("")
	-- 	self._ui.tips_img:setVisible(false)
	-- end
end

return ClassRef
